***Replication code for Garzia and Ferreira da Silva (2025) - In-party love, out-party hate, and affective polarization in twelve established democracies. Public Opinion Quarterly***

*use ...\Garzia and Ferreira da Silva - Replication data_main analysis.dta

*Fig1
twoway (scatter INPARTY YEAR, by(COUNTRY) mcolor(black) msize(small) ytitle("Mean thermometer value")) (lfit INPARTY YEAR, by(COUNTRY) lcolor(black)) (scatter OUTPARTY YEAR, by(COUNTRY) msize(small) mcolor(gs10)) (lfit OUTPARTY YEAR, by(COUNTRY, legend(pos(6))) lcolor(gs10)) 

*Fig2
twoway (scatter LOVE YEAR, by(COUNTRY) mcolor(black) msize(small) ytitle("Mean Love/Hate score")) (lfit LOVE YEAR, by(COUNTRY) lcolor(black)) (scatter HATE YEAR, by(COUNTRY) msize(small) mcolor(gs10)) (lfit HATE YEAR, by(COUNTRY, legend(pos(6))) lcolor(gs10)) 

*Fig3
twoway (scatter polarity YEAR, by(COUNTRY) mcolor(black) msize(small) legend(off) ytitle("Polarity")) (lfit polarity YEAR, ylabel(-2(2)8) by(COUNTRY, legend(off)) lcolor(black) yline(0, lpattern(solid) lcolor(gs12)))


*FigS1
twoway (scatter INPARTY_PID YEAR, by(COUNTRY) mcolor(black) msize(small) ytitle("Mean thermometer value")) (lfit INPARTY_PID YEAR, by(COUNTRY) lcolor(black)) (scatter OUTPARTY_PID YEAR, by(COUNTRY) msize(small) mcolor(gs10)) (lfit OUTPARTY_PID YEAR, by(COUNTRY, legend(pos(6))) lcolor(gs10)) 

*FigS2
twoway (scatter LOVE_PID YEAR, by(COUNTRY) mcolor(black) msize(small) ylabel(0(1)5) ytitle("Mean Love/Hate score")) (lfit LOVE_PID YEAR, by(COUNTRY) lcolor(black)) (scatter HATE_PID YEAR, by(COUNTRY) msize(small) mcolor(gs10)) (lfit HATE_PID YEAR, by(COUNTRY, legend(pos(6))) lcolor(gs10)) 

*FigS3
twoway (scatter polarity_PID YEAR, by(COUNTRY) mcolor(black) msize(small) ytitle("Polarity")) (lfit polarity_PID YEAR, ylabel(-2(2)8) by(COUNTRY, legend(pos(6))) lcolor(black) yline(0, lpattern(solid) lcolor(gs12)))


*Table S3
foreach n of numlist 3 5 9 10 14 17 19 20 24 25 27 28 {
	reg INPARTY c.YEAR if COUNTRY==`n'
	reg OUTPARTY c.YEAR if COUNTRY==`n'
	reg LOVE c.YEAR if COUNTRY==`n'
	reg HATE c.YEAR if COUNTRY==`n'
	reg polarity c.YEAR if COUNTRY==`n'
}

